////////////////////
// System Memory
////////////////////
/**
 * The `Browser.system.memory` API.
 *
 * Permissions: "system.memory"
 */
export namespace system.memory {
    export interface MemoryInfo {
        /** The total amount of physical memory capacity, in bytes. */
        capacity: number;
        /** The amount of available capacity, in bytes. */
        availableCapacity: number;
    }

    /** Get physical memory information. */
    export function getInfo(callback?: (info: MemoryInfo) => void): Promise<MemoryInfo> {
        return Wab.callFunctionAsync({ funcName: 'system.memory.getInfo' }).then(res => {
            callback?.(res)
            return res
        })
    }
}